<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/11/8
  Time: 10:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>update</title>
    <link href="//unpkg.com/layui@2.7.6/dist/css/layui.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/statics/layui/layui/layui.js" charset="utf-8"></script>
</head>
<body>
<div style="margin-top: 25px;margin-left: 50px">
    <div style="color: red">${errorMsg}</div>
    <form class="layui-form" action="${pageContext.request.contextPath}/user/updateUser/${sysUser.id}" method="post" enctype="multipart/form-data">
        <div class="layui-form-item">
            <label class="layui-form-label">账号：</label>
            <div class="layui-input-inline">
                <input type="text" name="account" id="account" value="${sysUser.account}" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                <span style="color: red">${accountError}</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">真实姓名：</label>
            <div class="layui-input-inline">
                <input type="text" name="realName" id="realName" value="${sysUser.realName}" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                <span style="color: red">${realNameError}</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码：</label>
            <div class="layui-input-inline">
                <input type="text" name="password" id="password" value="${sysUser.password}" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                <span style="color: red">${passwordError}</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别:</label>
            <div class="layui-input-inline">
                <input type="radio" name="sex" value="2" title="男" ${sysUser.sex==2 ? 'checked' : ''}>
                <input type="radio" name="sex" value="1" title="女" ${sysUser.sex==1 ? 'checked' : ''}>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">角色：</label>
            <div class="layui-input-inline">
                <select name="roleId" lay-filter="aihao">
                    <option value="1" ${sysUser.roleId==1 ? 'selected' : ''}>管理系统员</option>
                    <option value="2" ${sysUser.roleId==2 ? 'selected' : ''}>店长</option>
                    <option value="3" ${sysUser.roleId==3 ? 'selected' : ''}>店员</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">出生日期：</label>
            <div class="layui-input-inline">
                <input type="text" name="birthday" id="birthday" value="<fmt:formatDate value="${sysUser.birthday}" pattern="yyyy-MM-dd"/>" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">电话：</label>
            <div class="layui-input-inline">
                <input type="text" name="phone" id="phone" value="${sysUser.phone}" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">地址：</label>
            <div class="layui-input-inline">
                <input type="text" name="address" id="address" value="${sysUser.address}" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div>
            <label class="layui-form-label">证件照：</label>
            <img src="${pageContext.request.contextPath}/statics/upload/${sysUser.idpicpath}" width="70" height="60" alt=""><br><br>
            <label class="layui-form-label">修改为：</label>
            <input type="file" name="idPic">
        </div>
        <hr>

        <div class="layui-block">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" >确 定</button>
            </div>
        </div>
    </form>
</div>

<script>

    layui.use(['table','form','jquery','layer'], function(){
        var layer = layui.layer;
        var $ = layui.$;


        if (${msg==true}){
            layer.msg("修改成功",{
                icon: 1,
                time: 1000
            })
        }else if (${msg==false}){
            layer.msg("修改失败",{
                icon: 2,
                time: 1000
            })
        }

    });

</script>

</body>
</html>
